About the Crystal Reports Sample Code
Speed up the process of integrating reporting into your Windows and Web applications by taking advantage of the sample code included with Crystal Reports. By using the samples as models for your own code, or by copying the sample code directly, you’ll find out just how easy it is to pack the powerful reporting functionality of Crystal Reports into your applications.
The sample code is categorized by programming language—Visual Basic, Visual C++, Delphi, Lotus Domino, and web-based. See the Sample code listing below for a description of each sample. 
Note: The Visual C++, Delphi, and ASP samples are only installed if explicitly selected during a “Custom” installation or if a “Complete” installation is chosen. The Visual Basic and web samples are installed with a “Typical” installation. The Lotus domino samples are installed only if Lotus client software is detected on the local machine.
Getting started
New to Crystal Reports
Even if you’re just learning to integrate reporting in your applications, you’ll find most of the sample applications straightforward and easy to understand. The “Simple Report” in the Visual Basic folder is the best place to start. 
Web developers
Check out the sample ASP pages to find out how to integrate the Report Designer Component into your Internet or Intranet web site.
Windows developers 
Many of the features in Crystal Reports are demonstrated in the sample applications. If you’re looking for more sophisticated samples, be sure to take a look at “First Class Hotels” in the Visual Basic folder and “Pro Athlete Salaries” in both the Visual Basic and Visual C++ (Cpp) folders. If you are a user of the Crystal Report Engine API, Crystal ActiveX Control, or Crystal Report Engine Automation Server, please note that all the Visual Basic and Visual C++ samples and most of the web samples are written for the Report Designer Component. To learn all about migrating your applications to use the Report Designer Component, visit the Seagate Software Support Library at http://support.seagatesoftware.com/library.
Why use the Report Designer Component?   
The Report Designer Component (RDC) offers a dual interface COM component, which is the most advanced technology available for developers. The Report Designer Component is an ActiveX Designer that packs the reporting power of Crystal Reports. Developers creating applications in popular environments such as Visual Basic, Visual C++, Visual InterDev, and Office (VBA) can use the RDC to efficiently create the most powerful reporting functionality in their applications.
Crystal Reports supports the older integration methods (32-bit only). However, we recommend using the RDC—the newest and best reporting technology available—to create efficient and powerful reports that support the entire range of functionality available within Crystal Reports today.
What are the sample application requirements? 
Be sure to use Visual Basic 6.0 or Visual C++ 6.0 to view the Visual Basic or Visual C++ sample applications. As well, use version 8 (or later) of the Report Designer Component for which the sample code is designed. Please visit the Seagate Software Support Site at http://support.seagatesoftware.com to get more compatibility information.
Where can you get more sample applications?
Get more samples from the Seagate Software Support Site:
http://support.seagatesoftware.com/samples
Feedback?
Let us know what kind of samples you’d like to see. Email us at feedbackscr@seagatesoftware.com.
Sample code listing
This table lists the code samples by programming language, and offers a brief description of each sample. The directory location of each folder is included in the table; these locations will differ on your machine if Crystal Reports was not installed to the default program directory.
Sample Name	 Sample Description	Comments	
Visual Basic
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Visual Basic	
ADO Connection Methods		Demonstrates methods of adding ADO connections to reports.	These samples demonstrate various features of the Report Designer Component.	
Change Runtime Location of OLE Object Demo 	Sets the location of an OLE object at runtime using the SetOleLocation command.		
No Data in Report Event	Shows the "No Data" Event.		
Printer Settings	Changes Printer Settings at runtime.		
Report Creation API	Demonstrates the use of the Report Object Creation API Features.		
Report Variables	Demonstrates the use of Report Variables.		
Report Expert	Demonstrates the use of the Crystal Report Expert.		
Search and Select Experts	Programmatically controls the Search and Select Experts.		
Unbound Fields	Demonstrates one way to use Unbound Fields.		
Viewer Runtime Options	Manipulates properties of the Crystal Reports ActiveX Viewer at Runtime.		
Employee Profiles	Demonstrates runtime report manipulation through VB code.	These are introductory Visual Basic samples.	
Inventory Demo	Demonstrates runtime report manipulation through VB code. This is an intermediate level sample.		
Simple Report	Demonstrates beginner level report creation from within Visual Basic.		
Viewer	Manipulates the Smart Viewer through Visual Basic code at runtime. This is an intermediate level sample.		
Field Mapping	Demonstrates how to manipulate field mapping.		

Sample Name	 Sample Description	Comments	
Visual Basic
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Visual Basic	
First Class Hotels	A small hotel reservation system for a fictional company called First Class Hotels.	These are advanced Visual Basic samples.	
Load Picture	Loads pictures into a report at runtime through Visual Basic code.		
Pro Athlete Salary Report	Demonstrates Report Creation API features.		
Embeddable Designer Control	Demonstrates how to offer users the ability to design and view Crystal reports at runtime.		
C++ (Cpp)
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Cpp	
Pro Athlete Salary Report	Demonstrates Report Creation API features using Visual C++. This is an advanced sample.	
Delphi
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Delphi	
pedelf32.exe	Crystal Reports Print Engine demonstration for Delphi 2.0 or higher. Contains sample code for the commonly used API calls. This is not an RDC sample.	
Web and Active Server Pages
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Web	
Unbound Fields Sample	Creates a report at runtime using unbound fields. The sample allows the user to select the order that the fields appear, the group, and group sort direction.	These web-enabled samples show some of the features of the Report Designer Component.	
ADO Recordset Sample	Passes an ADO recordset to a report.		
Report Exporting Sample	Exports a report to a variety of different file formats and delivers that file to the browser.		
Parameter Field Demo	Passes a parameter field value to a report.		
Selection Formula Demo	Passes a record selection formula to a report at runtime.		
Sort Fields Demo		Modifies an existing SORT field in the report and add a Sort field to the report at runtime.		

Sample Name	 Sample Description	Comments	
Lotus Notes Data
C:\NOTES\DATA	
Xglobal85.nsf	This Lotus Domino application invokes a report from both a form and a view using the Automation Server, as well as the print engine API. The report invoked in both cases is Lotusmap.rpt, which has been installed in the Crystal Reports\Samples\en\Code\Lotus Domino directory.	These sample applications show Lotus Domino integration. They are installed only if Lotus client software is detected on the local machine.
	
Crazev85.nsf	This Lotus Domino application invokes a report from both a form and a view using the Automation Server as well as the Active X Control (OCX). The report invoked in both cases is World Wide Sales.rpt, which is installed in the Crystal Reports\Samples\en\Code\Lotus Domino directory.		
Lotus Domino sample reports
C:\Program Files\Seagate Software\Crystal Reports\Samples\en\Code\Lotus Domino	
Lotusmap.rpt	A report that was created on Xglobal85.nsf data using the Domino native driver. The Xglobal85.nsf is installed into your Notes\Data directory.	These sample reports show the potential for integrating Crystal reporting within a Lotus Domino environment. They are installed only if Lotus client software is detected on the local machine.	
World Wide Sales.rpt	A report that was created on Crazev85.nsf data using the Domino native driver. The Crazev85.nsf is installed into your Notes\Data directory.